Skip to main content
GET
/
public
/
v1
/
toppie
/
campaigns
/
{campaign-id}
[BETA] Get Toppie Campaign Details
curl --request GET \
  --url https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id} \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.topsort.com/public/v1/toppie/campaigns/{campaign-id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "budget": 123,
  "startDate": "2023-11-07T05:31:56Z",
  "endDate": "2023-11-07T05:31:56Z",
  "targetRoas": 10.25,
  "currencyCode": "<string>",
  "isActive": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "bidCount": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

A valid API key generated in Topsort's UI. Use the TSE API key if calling auctions or events API, otherwise use the TSC API key.

Path Parameters

campaign-id
string<uuid>
required

The ID of the campaign.

Response

Successful Response

Represents a public version of an agency campaign, used in API responses.

id
string<uuid>
required

Internal identifier for the agency campaign

name
string
required

Campaign name

adFormat
enum<string>
required

The ad format for this campaign

Available options:
banner,
listing
chargeType
enum<string>
required

The charge type for this campaign

Available options:
CPM,
CPC,
CPA
accountId
string<uuid>
required

Account that owns this campaign

budget
integer
required

Total budget for this campaign

budgetPeriod
enum<string>
required

The periodicity of the budget

Available options:
daily,
weekly,
monthly,
total
startDate
string<date-time>
required

Date when the campaign starts, specified in RFC 3339. Must include the Timezone definition.

endDate
string<date-time>
required

Date when the campaign ends, specified in RFC 3339. Must include the Timezone definition.

targetRoas
number
required

Target ROAS for the campaign

Required range: 0.5 <= x <= 20
currencyCode
string
required

Currency code this campaign is working with in ISO 4217 format

Example:

"USD"

isActive
boolean
required

Flag to indicate if the campaign is active or not

createdAt
string<date-time>
required

Date and time when the campaign was created

bidCount
integer | null

Bid count for the campaign (optional)